Page({
    data: {
        iphoneXheight: 85,
        currentData: 0,
        list: [{
            image: '../../../static/image/CommodityReservation.png',
            icon: '../../../static/icon/stauts.png',
            name: '被褥',
            price: '222.22',
            goods: '床上用品'
        }, {
            image: '../../../static/image/CommodityReservation.png',
            icon: '../../../static/icon/NotPurchased.png',
            name: '被褥',
            price: '222.22',
            goods: '床上用品'
        }],
        purchased: [{
            image: '../../../static/image/CommodityReservation.png',
            title: '这是商品的名称',
            number: '1',
            product: '床上用品'
        }, {
            image: '../../../static/image/CommodityReservation.png',
            title: '这是商品的名称',
            number: '1',
            product: '床上用品'
        }]
    },
    onLoad: function(options) {
        if (wx.getSystemInfoSync().model != "iPhone X") {
            this.setData({
                iphoneXheight: 65
            })
        }
    },
    //获取当前滑块的index
    bindchange: function(e) {
        const that = this;
        that.setData({
            currentData: e.detail.current
        })
    },
    //点击切换，滑块index赋值
    checkCurrent: function(e) {
        const that = this;
        if (that.data.currentData === e.target.dataset.current) {
            return false;
        } else {
            that.setData({
                currentData: e.target.dataset.current
            })
        }
    },
    jump_CommodityReservation: function() {
        wx.navigateTo({
            url: 'CommodityDetail/CommodityDetail',
        })
    },
})